package demo1;

import org.springframework.stereotype.Component;

/**
 * 凡是希望被Spring容器管理的类，需要添加一个注解:@Component
 *
 * Component:组件
 */
@Component
public class User {
    public void sayHello(){
        System.out.println("User:hello!");
    }
}
